import request from '@/utils/request'

// 获取活动列表
export function getActivityList(params) {
  return request({
    url: '/api/social/activities',
    method: 'get',
    params
  })
}

// 获取活动详情
export function getActivityDetail(id) {
  return request({
    url: `/api/social/activities/${id}`,
    method: 'get'
  })
}

// 报名参加活动
export function participateInActivity(data) {
  return request({
    url: '/api/social/activities/participate',
    method: 'post',
    data
  })
}

// 取消报名活动
export function cancelParticipation(id) {
  return request({
    url: `/api/social/activities/${id}/cancel`,
    method: 'post'
  })
}

// 获取我的活动
export function getMyActivities(params) {
  return request({
    url: '/api/social/my-activities',
    method: 'get',
    params
  })
}

// 发布新活动
export function publishActivity(data) {
  return request({
    url: '/api/social/activities',
    method: 'post',
    data
  })
}

// 更新活动信息
export function updateActivity(id, data) {
  return request({
    url: `/api/social/activities/${id}`,
    method: 'put',
    data
  })
}

// 删除活动
export function deleteActivity(id) {
  return request({
    url: `/api/social/activities/${id}`,
    method: 'delete'
  })
}

// 获取活动统计数据
export function getActivityStats() {
  return request({
    url: '/api/social/activities/stats',
    method: 'get'
  })
}

// 获取用户信用分历史
export function getCreditHistory(params) {
  return request({
    url: '/api/social/user/credit/history',
    method: 'get',
    params
  })
}

// 获取活动类型列表
export function getActivityTypes() {
  return request({
    url: '/api/social/activities/types',
    method: 'get'
  })
}

// 获取活动地点列表
export function getActivityLocations() {
  return request({
    url: '/api/social/activities/locations',
    method: 'get'
  })
}

// 获取活动推荐列表
export function getRecommendedActivities() {
  return request({
    url: '/api/social/activities/recommended',
    method: 'get'
  })
}

// 获取热门活动列表
export function getHotActivities() {
  return request({
    url: '/api/social/activities/hot',
    method: 'get'
  })
}

// 获取活动评论列表
export function getActivityComments(activityId, params) {
  return request({
    url: `/api/social/activities/${activityId}/comments`,
    method: 'get',
    params
  })
}

// 提交活动评论
export function submitActivityComment(data) {
  return request({
    url: '/api/social/activities/comments',
    method: 'post',
    data
  })
}

// 获取活动排行榜
export function getActivityRanking(params) {
  return request({
    url: '/api/social/activities/ranking',
    method: 'get',
    params
  })
}

// 获取用户贡献统计
export function getUserContribution() {
  return request({
    url: '/api/social/user/contribution',
    method: 'get'
  })
}

// 获取环保知识问答题目
export function getQuizQuestions() {
  return request({
    url: '/api/social/quiz/questions',
    method: 'get'
  })
}

// 获取活动日历
export function getActivityCalendar(params) {
  return request({
    url: '/api/social/activities/calendar',
    method: 'get',
    params
  })
}

// 获取活动地图数据
export function getActivityMapData() {
  return request({
    url: '/api/social/activities/map',
    method: 'get'
  })
} 